import java.util.*;
import java.io.*;

class linear_search
{
	public static void main (String[] args) 
	{
		System.out.print("\n \n Please enter the size of the array: ");
		int n = getInt();	// get size of array
		int a[] = new int[n]; // array defined with dynamic size
		
		// Populate the array
		System.out.println("\n");
		for(int i=0;i<n;i++)
		{
			System.out.print("\n Please Enter the a["+(i+1)+"] = ");
			a[i]=getInt();
		}
		
		// get KEY from the user
		System.out.print("\n Please enter the key to search : KEY = ");
		int KEY = getInt();
		int k = 0;
		
		// Searching for KEY
		for(int i=0;i<n;i++)
		{
			if(KEY==a[i])
			{
				System.out.println(" \n Key found @ loc: a["+(i+1)+"] ");
				k++;
			}
			if(i==(n-1)&&(k==0))
			{
				System.out.print("\n Key Not Found \n\n\t\t\t *~ Program Terminates ~*");
			}
		}		
	}
	
	
	// This method accepts integer values from the user 
	// and return those values to the caller method
	static int getInt()
	{
		Scanner kbd = new Scanner(System.in);
		int n = kbd.nextInt();
		return n;
	}
}